package com.zhhh.repository;

import java.util.List;
import java.util.Set;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.zhhh.domain.BRoleModeEm;

public interface RoleModeEmRepository extends CrudRepository<BRoleModeEm, Integer>{


	
	@Query("select s from BRoleModeEm s where s.roleCode = :roleCode and s.emId = :emId")
	BRoleModeEm findByRoleCodeAndEmId(String roleCode, String emId);

	@Query("select s from BRoleModeEm s where s.roleCode = :roleCode and s.ctrlId = :ctrlId")
	Set<BRoleModeEm> findByRoleCodeAndCtrlId(String roleCode, String ctrlId);

	@Query("select s from BRoleModeEm s where s.roleCode = :roleCode and s.emId = :emId and s.ctrlId = :ctrlCode and s.modeCode = :modeCode")
	BRoleModeEm findByRoleCodeAndEmIdAndCtrlCodeAndModeCode(String roleCode, String emId, String ctrlCode,
			String modeCode); 
}
